<%@ page language="java" contentType="text/html; charset=UTF8" pageEncoding="UTF8"%>
<%@ include file="/jsp/base/taglibs.jsp"%>
<form action="#" id="edit-form">
<input type="hidden" name="id" value="${car.id }" />
<table class="table">
	<tr> 
		<td>车牌号：</td>
		<td colspan="3">
			<select name="license">
				<option value="鲁B65825">鲁B65825</option>
				<option value="鲁B25871">鲁B25871</option>
				<option value="鲁B12345">鲁B12345</option>
				<option value="鲁B54321">鲁B54321</option>
				<option value="鲁B11111">鲁B11111</option>
			</select>
		</td>
	</tr>
	<tr>
		<td>用车人：</td>
		<td colspan="3">
			<input type="text" name="username" value="${car.username }" />
		</td>
	</tr>
	<tr>
		<td>开始时间：</td>
		<td>
			<input type="text" name="startTime" value='<fmt:formatDate value="${car.startTime }" pattern="yyyy-MM-dd" />' />
		</td>
		<td>结束时间：</td>
		<td>
			<input type="text" name="endTime" value='<fmt:formatDate value="${car.endTime }" pattern="yyyy-MM-dd" />' />
		</td>
	</tr>
	<tr>
		<td>目的地：</td>
		<td>
			<input type="text" name="addr" value="${car.addr }" />
		</td>
		<td>申请里程：</td>
		<td>
			<input type="text" name="mileage" value="${car.mileage }" style="width:50px;"/>公里
		</td>
	</tr>
	<tr>
		<td>原因：</td>
		<td colspan="3">
			<textarea name="reason" style="width:400px;">${car.reason }</textarea>
		</td>
	</tr>
	<tr>
		<td>备注：</td>
		<td colspan="3">
			<textarea name="remark" style="width:400px;">${car.remark }</textarea>
		</td>
	</tr>
	<tr>
		<td>短信提醒：</td>
		<td colspan="3">
			<input type="checkbox" name="send" value="1" />&nbsp;<span>短信提醒</span>
		</td>
	</tr>
		 
	<tr>
		<td colspan="4" align="center">
			<a href="javascript:void(0)" class="btn btn-primary  " onclick="update()" >保存</a>
			<a href="javascript:void(0)" class="btn btn-default " onclick="closeModal()">取消</a>
		</td>
	</tr>
</table>
</form>
<script>
$(function() {
	var license = "${car.license}";
	$("#edit-form select[name=license]").val(license);
	
	var send = "${car.send}";
	if(send == 1) {
		$("#edit-form input[name=send]").prop("checked", "checked");
	} else {
		$("#edit-form input[name=send]").removeProp("checked");
	}
	
})
</script>
